package com.online.usermanagesystem;

import com.online.usermanagesystem.Interceptor.AccessibleInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 客户管理系统入口
 *
 * @author hsc
 */
@EnableDiscoveryClient
@EnableFeignClients
@SpringBootApplication
public class UserManageSystemApplication extends WebMvcConfigurationSupport {

    @Autowired
    private AccessibleInterceptor accessibleInterceptor;

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(UserManageSystemApplication.class);
        springApplication.run(args);
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(accessibleInterceptor).addPathPatterns("/*/*");
        super.addInterceptors(registry);
    }
}
